package com.plpm.exception;

/**
 * 文件下载异常
 *
 * @author PLPM Team
 * @version 1.0
 */
public class FileDownloadException extends Exception {
    private final int syncStatus; // 0-未拉取，2-拉取失败
    
    // 保留原有构造方法，默认syncStatus=2（拉取失败）
    public FileDownloadException(String message) {
        super(message);
        this.syncStatus = 2; // 默认拉取失败
    }
    
    public FileDownloadException(String message, Throwable cause) {
        super(message, cause);
        this.syncStatus = 2; // 默认拉取失败
    }
    
    // 新增：支持指定syncStatus的构造方法
    public FileDownloadException(String message, int syncStatus) {
        super(message);
        this.syncStatus = syncStatus;
    }
    
    public FileDownloadException(String message, int syncStatus, Throwable cause) {
        super(message, cause);
        this.syncStatus = syncStatus;
    }
    
    public int getSyncStatus() {
        return syncStatus;
    }
}

